export default {
  data () {
    return {
      tableInfo: {
        loading: false,
        list: [],
        selection: [],
        columns: [],
      },
      exportLoading: false,
      pagination: {
        pageNum: 1, // 当前页码
        pageSize: 50 // 当前页码size
      },
      total: 0, // 总条数
      pageSizes: [50, 100, 500, 1000] // 页码size options
    }
  },
  methods: {
    // 获取表单内容
    getFormData (data) {
      this.formData = data;
    },
    // 表单查询
    handleQueryForm () {
      this.pagination.pageNum = 1;
      this.getTableData();
    },
    // 页码切换
    handlePageChange (val) {
      this.pagination.pageNum = val;
      this.getTableData();
    },
    // 每页条数切换
    handlePageSizeChange (val) {
      this.pagination.pageSize = val;
      this.getTableData();
    },
    // 设置总页数
    setTotalNum (totalNum) {
      this.pagination.total = totalNum;
    },
    // 表格勾选操作
    selectionChange (rows) {
      this.tableInfo.selection = rows;
    },
  }
}
